package com.ruoyi.web.controller.test;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 密码测试控制器
 */
@RestController
@RequestMapping("/test")
public class PasswordTestController {
    
    @GetMapping("/password")
    public String getEncodedPassword() {
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        String rawPassword = "123456";
        String encodedPassword = encoder.encode(rawPassword);
        
        return String.format("原始密码: %s\n加密后的密码: %s", rawPassword, encodedPassword);
    }
} 